package com.dis.handler;

import com.dis.entity.BaseData;
import com.lmax.disruptor.ExceptionHandler;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class BaseExecptionHandler implements ExceptionHandler<BaseData> {
    public void handleEventException(Throwable ex, long sequence, BaseData event) {
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.info("处理未捕获异常");
    }

    public void handleOnStartException(Throwable ex) {
        log.info("拦截的异常在启动的时候就直接抛出");
    }

    public void handleOnShutdownException(Throwable ex) {
        log.info("拦截的一场在结束的时候抛出");
    }
}
